<?php
/**
 * History plugin voor Front Controller.
 *
 * Voeg dit toe in application.ini:
 * resources.frontController.plugins.history = "Ahs_Controller_Plugin_History"
 *
 * @author Olivier Parent
 * @copyright Copyright (c) 2011 Artevelde University College Ghent
 */
class Ahs_Controller_Plugin_History extends Zend_Controller_Plugin_Abstract
{
    public function __construct()
    {
        $session = new Zend_Session_Namespace('history');

        $currUri = Zend_Controller_Front::getInstance()->setRequest( new Zend_Controller_Request_Http() )
                                                       ->getRequest()
                                                       ->getRequestUri();

        $session->prevUri = isset ($session->currUri) ? $session->currUri : null;
        $session->currUri = $currUri;
    }
}
